
import Phaser from "phaser";

export default class UtilsPathFollow extends Phaser.GameObjects.PathFollower {
    constructor(_options, _that) {
        super(_that,  _options.path, _options.x, _options.y, _options.key);
        _options.scal ? super.setScale(_options.scal) : null;
        _options.playKey ? super.play(_options.playKey) : null;
        this.startFollow({
            duration: _options.starFol.dur,
            yoyo: _options.starFol.yoyo,
            repeat: _options.starFol.rep,
            rotationOffset: _options.starFol.rotOff,
            rotateToPath: _options.starFol.rotPath
        });
    }
}